<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: lucky
  Date: 2020/9/6
  Time: 15:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
添加学生
<form id="form1" name="form1" method="post" action="/updateStu">
    <p>学号:
        <input type="text" readonly name="studentno" id="ss" value="${Stu.studentno}"/>
    </p>
    <p>姓名:
        <input type="text" name="studentname" id="textfield" value="${Stu.studentname}"/>
    </p>
    <p>年龄:
        <input type="text" name="age" id="textfield2" value="${Stu.age}"/>
    </p>
    <p>性别:
        <input name="sex" type="radio" id="radio" value="男" ${Stu.sex=="男"?"checked=checked":""}/>
        男
        <input type="radio" name="sex" id="radio2" value="女" ${Stu.sex=="女"?"checked=checked":""}/>
        女
    </p>
    <p>生日:
        <input type="date" name="borndate" value="<fmt:formatDate value="${Stu.borndate}" pattern="yyyy-MM-dd"></fmt:formatDate>">
    </p>
    <p>地址:
        <input type="text" name="address" id="textfield4" value="${Stu.address}"/>
    </p>
    <p>状态:
        <input type="text" name="state" id="textfield5" value="${Stu.state}"/>
    </p>
    <p>年级:
        <select name="gradeid">
            <option value="0">全部</option>
            <c:forEach var="gid" items="${grade}">
                <option value="${gid.gradeid}" ${Stu.gradeid==gid.gradeid?"selected=selected":""}>${gid.gradename}</option>
            </c:forEach>
        </select>
        下拉列表，从数据库中查询年级
    </p>
    <p>
        <input type="submit" name="button" id="button" value="添加" />
    </p>
</form>

</body>
</html>
